﻿var titBook = titBook || {};
titBook.module = titBook.module || {};
titBook.module.people = titBook.module.people || {};

titBook.core.register("people-module", function (sandbox) {

    //var ko = sandbox.getObservable();

    //var NameModel = function (first, last) {
    //    this.firstName = ko.observable(first);
    //    this.lastName = ko.observable(last);

    //    this.fullName = ko.computed(function () {
    //        // Knockout tracks dependencies automatically. It knows that fullName depends on firstName and lastName, because these get called when evaluating fullName.
    //        return this.firstName() + " " + this.lastName();
    //    }, this);
    //};

    //var nameModel;

    return {
        activate: function () {

            var peopleVM = new titBook.viewModels.peopleViewModel();
            sandbox.bind(peopleVM);

            //titBook.core.communications.addListener("someEvent", function () { alert("event was handled"); }, "someContext");

            //titBook.core.communications.notify("someEvent");

            //sandbox.addListener("Name", function (firstName, lastName) {
            //    nameModel.firstName(firstName);
            //    nameModel.lastName(lastName);
            //}, this);
        },
        destroy: function () {

        }
    };
});